﻿namespace AgileBoard.Infrastructure.Data.Repositories
{
    using System.Collections.Generic;
    using Domain;
    using Domain.DataInterfaces;
    using SharpArch.Data.NHibernate;

    public class WorkItemDao : Repository<WorkItem>, IWorkItemRepository
    {
        #region IWorkItemRepository Members

        public IList<WorkItem> FindByStatus(string statusId)
        {
            return Session.CreateQuery("from Story where FeatureID = :statusId")
                .SetParameter("statusId", statusId)
                .List<WorkItem>();
        }

        public IList<WorkItem> FindByStory(string storyId)
        {
            return Session.CreateQuery("from Story where IterationID = :storyId")
                .SetParameter("storyId", storyId)
                .List<WorkItem>();
        }

        #endregion
    }
}